package com.reading.core.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * @author guwenqi_1995@163.com
 * @date 2019/7/8 9:30 AM
 **/
@Getter
@Setter
public class AloneException extends RuntimeException{

    /**
     * 错误编号
     */
    private Integer errorCode;

    /**
     * 错误描述
     */
    private String errorDescr;

    public AloneException() {
        this.errorCode = ExceptionCode.ERROR.getErrorCode();
        this.errorDescr = ExceptionCode.ERROR.getErrorDescr();
    }

    public AloneException(ExceptionCode code) {
        this.errorCode = code.getErrorCode();
        this.errorDescr = code.getErrorDescr();
    }

    public AloneException(String errorDescr) {
        this.errorCode = ExceptionCode.ERROR.getErrorCode();
        this.errorDescr = errorDescr;
    }
}
